Method of determining power measurements in an electrical energy meter

ABSTRACT

A method is described for metering electrical energy. The method includes sensing each phase of a circuit to generate analog voltage signals and analog current signals associated with each phase. The analog voltage signals and said analog current signals are converted into digital voltage signals and digital current signals, respectively, using time division multiplexing to provide three digital outputs. The digital outputs comprise at least one digital voltage signal and at least one digital current signal associated with the same phase. The digital outputs are processed to generate signals representative of real power, the magnitude of reactive power, and apparent power, wherein the signals representative of the magnitude of reactive power are generated from the signals representative of real power and the signals representative of apparent power.

RELATED APPLICATION DATA

This application is a continuation of U.S. patent application Ser. No.08/259,578, filed Jun. 14, 1994 (now abandoned), which is a continuationof U.S. patent application Ser. No. 07/839,182, filed Feb. 21, 1992, nowabandoned.

FIELD OF INVENTION

The present invention relates generally to the field of utility companymeters for metering electrical energy. More particularly, the presentinvention relates to both electronic watthour meters and meters utilizedto meter real and reactive energy in both the forward and reversedirections.

BACKGROUND OF THE INVENTION

Meters for metering the various forms of electrical energy are wellknown. Utility company meters can be of three general types, namely,electro-mechanical based meters (output generated by a rotating disk),purely electronic component based meters (output component generatedwithout any rotating parts) and a hybrid mechanical/electronic meter. Inthe hybrid meter, a so-called electronic register is coupled, usuallyoptically, to a rotating disk. Pulses generated by the rotating disk,for example by light reflected from a spot painted on the disk, areutilized to generate an electronic output signal.

It will be appreciated that the use of electronic components in electricenergy meters has gained considerable acceptance due to theirreliability and extended ambient temperature ranges of operation.Moreover, contemporary electronic signal processing devices, such asmicroprocessors, have a greater accuracy potential for calculatingelectrical energy use than prior mechanical devices. Consequently,various forms of electronic based meters have been proposed which arevirtually free of any moving parts. Several meters have been proposedwhich include a microprocessor.

U.S. Pat. No. 4,298,839--Johnston, incorporated herein by reference,discloses a programmable alternating current electric energy meterhaving a radiation responsive external data interface. The meter isshown to include a metering sequence logic control circuit which in thepreferred embodiment is stated to be formed by a single-chipmicrocomputer, type MK 3870 available from Mostek Corporation ofCarrollton, Tex. The logic control circuit is said to be operative tocalculate and accumulate different measured parameters of an electricalenergy quantity. Current and voltage components are provided to thelogic control circuit from a convertor which produces current andvoltage pulses at a rate proportional to the rate of the particularelectrical energy consumed. The converter incorporates a rotating disk.

U.S. Pat. No. 4,467,434--Hurley et al., discloses a solid-statewatt-hour meter which includes a current sensing device and a voltagesensing device coupled to a Hall-effect sensing and multiplying device.The Hall-effect device is coupled to a microprocessor.

U.S. Pat. No. 4,692,874--Mihara, discloses an electronic watt-hour meterwhich includes a single microprocessor and a power measuring device. Thepower measuring device is described as including an electric powerconverting circuit and a frequency divider. The electric powerconverting circuit provides an output pulse, the frequency of which isdivided by the frequency divider. The frequency divider, however, isdependent upon a frequency dividing, ratio setting signal generated bythe microprocessor.

U.S. Pat. No. 4,542,469--Brandyberry et al., discloses a hybrid typemeter having a programmable demand register with a two-way communicationoptical port. The demand register is said to include a centralprocessing unit such as the NEC 7503 microcontroller. Themicrocontroller is utilized not only for controlling and monitoring thedemand register, but also to perform power and energy calculations.

U.S. Pat. No. 4,884,021--Hammond et al. discloses a meter for meteringpolyphase power sources wherein cycles for each phase are sampled ateach degree and converted to a binary representation of amplitude.Conversion is described as being carried out in two steps, the firstbeing a range conversion where the sampled amplitude is evaluated withrespect to eleven possible ranges of amplitude or scaling factors. Thatrange data is then stored and the sample is amplified in accordance withthe desired range code and submitted to an analogue to digitalconverter. A general purpose digital signal processor is said to beutilized for treating the parameters derived from each sample and todevelop pulse outputs which can be further processed or displayed bydevices of conventional use in the industry. An electronic register isprovided which is said to be controlled by a conventionalmicroprocessor. The implementation of Hammond's range conversion schemeresults in the energy measurement components effectively being "hardcoded" with the particular metering scheme, thereby significantlyreducing the adaptability of the meter for various known applications.The use of such a meter in the various utility company applicationsrequires either keeping several different meter types in inventory, i.e.one meter type for each type of application, or one meter into which allapplication forms have been incorporated. It will be appreciated thatone meter into which all application forms have been incorporated wouldbe exorbitantly expensive.

Meters, such as those described above, which incorporate registers, aregenerally programmable at two levels. At the first level, firmware canbe masked into a register in a relatively short period of time. At thesecond level, so-called soft switches can be programmed into nonvolatilememory, i.e., electrically erasable programmable read only memory, totell the firmware which algorithms to perform. Such systems work wellfor presently provided base metering data. However, such systems cannotchange basic meter functions nor are they adaptable to use withadditional hardware. While adequate for present applications, suchmetering systems are significantly non-flexible in relation to futureneeds and/or developments in both hardware and programmability.

U.S. Pat. No. 4,077,061--Johnston et al. discloses a digital processingand calculating AC electric energy metering system. This system includesa single central processing unit for performing all energydeterminations, system control and information display. Although thissystem does provide energy determination as output signals from thesystem, the system is not adaptable for modification of basic meteringfunctions from external hardware or in relation to externalcommunication signals.

Consequently, a need exits for an electronic meter which is designed tobe programmable to the extent that basic metering functions can bechanged relatively easily and which is economically adaptable for usewith additional hardware. Such a meter would be capable of modificationto handle various meter forms, to store calibration constants and to becapable of modification for future metering requirements. The presentinvention solves the aforementioned problems through the use of adistributed processing electronic meter incorporating a meteringprocessor which is adaptable to multiple metering applications and whichis utilized to perform all electrical energy determinations and a secondprocessor which generates a display signal based on such electricalenergy determinations, serves to control the overall operation of themeter and which provides access to processing, storage and displayinformation for future hardware additions.

SUMMARY OF THE INVENTION

The above problems are overcome and the advantages of the invention areachieved in methods and apparatus for metering electrical energy in anelectronic meter. Such meter includes a first processor for determiningelectrical energy from voltage and current signals and for generating anenergy signal representative of the electrical energy determination anda second processor for receiving the energy signal and for generating anindication signal representative of said energy signal. An optionconnector is connected to the first and second processors, whereby theenergy signal is provided to the option connector and a communicationconnection is provided between the option connector and the secondprocessor. It is preferred for the option connector to be provided powersignals such used by the meter in order to power any electroniccomponents which may be connected to the option connector. It is alsopreferred to provide the option connector with certain operation signalssuch as a power fail signal, a master reset signal, an end of demandsignal, and a KYZ signal. It is still further preferred to provide theoption connector with the potential to communicate with variouscomponents of the meter, such as serial data communication,communication signals transmitted and received through an optical portand display signals. It is also preferred for the first processor toinclude a comparator, connected to receive a precision voltage and areference voltage, wherein a comparator signal is generated whenever thereference voltage exceeds the precision voltage. It is also preferredfor the meter to include a non-volatile memory such as an electricallyerasable programmable read only memory connected to the first and secondprocessors, for storing data used by the processors and for storinginformation generated by the processors.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention will be better understood, and its numerousobjects and advantages will become apparent to those skilled in the artby reference to the following detailed description of the invention whentaken in conjunction with the following drawings, in which:

FIG. 1 is a block diagram of an electronic meter constructed inaccordance with the present invention;

FIG. 2 is a block diagram of the A/D&DSP processor shown in FIG. 1;

FIGS. 3A-3E combine to provide a flow chart of the primary programutilized by the microcontroller disclosed in FIG. 1;

FIG. 4 is a flow chart of the download program utilized by themicrocontroller shown in FIG. 1;

FIG. 5 is a schematic diagram of the optical port disclosed in FIG. 1;

FIG. 6 is a schematic diagram of the resistive dividers and precisionreference disclosed in FIG. 1.

FIG. 7 is a schematic diagram of the 5 volt linear power supply shown inFIG. 1; and

FIG. 8 is a schematic diagram of various electronic button switchesutilized by the microcontroller shown in FIG. 1.

DETAILED DESCRIPTION

A new and novel meter for metering electrical energy is shown in FIG. 1and generally designated 10. It is noted at the outset that this meteris constructed so that the future implementation of higher levelmetering functions can be supported. Such future implementation featureis described in greater detail herein.

Meter 10 is shown to include three resistive voltage divider networks12A, 12B, 12C; a first processor--an ADC/DSP (analog-to-digitalconverter/digital signal processor) chip 14; a second processor--amicrocontroller 16 which in the preferred embodiment is a MitsubishiModel 50428 microcontroller; three current sensors 18A, 18B, 18C; a 12 Vswitching power supply 20 that is capable of receiving inputs in therange of 96-528 V; a 5 V linear power supply 22; a nonvolatile powersupply 24 that switches to a battery 26 when 5 V supply 22 isinoperative; a 2.5 V precision voltage reference 28; a liquid crystaldisplay (LCD) 30; a 32.768 kHz oscillator 32; a 6.2208 MHz oscillator 34that provides timing signals to chip 14 and whose signal is divided by1.5 to provide a 4.1472 MHz clock signal to microcontroller 16; a 2kByte EEPROM 35; a serial communications line 36; an option connector38; and an optical communications port 40 that may be used to read themeter. The inter-relationship and specific details of each of thesecomponents is set out more fully below.

It will be appreciated that electrical energy has both voltage andcurrent characteristics. In relation to meter 10, voltage signals areprovided to resistive dividers 12A-12C and current signals are inducedin a current transformer (CT) and shunted. The output of CT/shuntcombinations 18A-18C is used to determine electrical energy.

First processor 14 is connected to receive the voltage and currentsignals provided by dividers 12A-12C and shunts 18A-18C. As will beexplained in greater detail below, processor 14 converts the voltage andcurrent signals to voltage and current digital signals, determineselectrical energy from the voltage and current digital signals andgenerates an energy signal representative of the electrical energydetermination. Processor 14 will always generate watthour delivered (WhrDel) and watthour received (Whr Rec) signals, and depending on the typeof energy being metered, will generate either volt amp reactive hourdelivered (VARhr Del)/volt amp reactive hour received (VARhr Rec)signals or volt amp hour delivered (VAhr Del)/volt amp hour received(VAhr Rec) signals. In the preferred embodiment, each transition onconductors 42-48 (each transition from logic low to logic high or viceversa) is representative of the measurement of a unit of energy. Secondprocessor 16 is connected to first processor 14. As will be explained ingreater detail below, processor 16 receives the energy signal(s) andgenerates an indication signal representative of the energy signal.

In relation to the preferred embodiment of meter 10, currents andvoltages are sensed using conventional current transformers (CT's) andresistive voltage dividers, respectively. The appropriate multiplicationis accomplished in a new integrated circuit, i.e. processor 14. Althoughdescribed in greater detail in relation to FIG. 2, processor 14 isessentially a programmable digital signal processor (DSP) with built inanalog to digital (A/D) converters. The converters are capable ofsampling three input channels simultaneously at 2400 Hz each with aresolution of 21 bits and then the integral DSP performs variouscalculations on the results.

Meter 10 can be operated as either a demand meter or as a so-called timeof use (TOU) meter. It will be recognized that TOU meters are becomingincreasingly popular due to the greater differentiation by whichelectrical energy is billed. For example, electrical energy meteredduring peak hours will be billed differently than electrical energybilled during non-peak hours. As will be explained in greater detailbelow, first processor 14 determines units of electrical energy whileprocessor 16, in the TOU mode, qualifies such energy units in relationto the time such units were determined, i.e. the season as well as thetime of day.

All indicators and test features are brought out through the face ofmeter 10, either on LCD 30 or through optical communications port 40.Power supply 20 for the electronics is a switching power supply feedinglow voltage linear supply 22. Such an approach allows a wide operatingvoltage range for meter 10.

In the preferred embodiment of the present invention, the so-calledstandard meter components and register electronics are for the firsttime all located on a single printed circuit board (not shown) definedas an electronics assembly. This electronics assembly houses powersupplies 20, 22, 24 and 28, resistive dividers 12A-12C for all threephases, the shunt resistor portion of 18A-18C, oscillator 34, processor14, processor 16, reset circuitry (shown in FIG. 8), EEPROM 35,oscillator 32, optical port components 40, LCD 30, and an option boardinterface 38. When this assembly is used for demand metering, thebilling data is stored in EEPROM 35. This same assembly is used for TOUmetering applications by merely utilizing battery 26 and reprogrammingthe configuration data in EEPROM 35.

Consider now the various components of meter 10 in greater detail.Primary current being metered is sensed using conventional currenttransformers. It is preferred for the current transformer portion ofdevices 18A-18C have tight ratio error and phase shift specifications inorder to limit the factors affecting the calibration of the meter to theelectronics assembly itself. Such a limitation tends to enhance the easewith which meter 10 may be programmed. The shunt resistor portion ofdevices 18A-18C are located on the electronics assembly described aboveand are preferably metal film resistors with a maximum temperaturecoefficient of 20 ppm/°C.

The phase voltages are brought directly to the electronic assembly whereresistive dividers 12A-12C scale these inputs to processor 14. In thepreferred embodiment, the electronic components are referenced to thevector sum of each line voltage for three wire delta systems and toearth ground for all other services. Resistive division is used todivide the input voltage so that a very linear voltage with minimalphase shift over a wide dynamic range can be obtained. This incombination with a switching power supply allows the wide voltageoperating range to be implemented.

Referring briefly to FIG. 6, each resistive divider consists of two 1Meg, 1/2 watt resistors 50/52, 54/56 and 58/60, respectively. Resistors50-60 are used to drop the line voltage at an acceptable watt loss. Eachresistor pair feeds a third resistor 62, 64 and 66, respectively.Resistors 62-66 are metal film resistors having a maximum temperaturecoefficient of 25 ppm/°C. This combination is very inexpensive comparedto other voltage sensing techniques. Resistors 50-60 have an operatingvoltage rating of 300 Vrms each. These resistors have been individuallytested with the 6 kV IEEE 587 impulse waveforms to assure that theresistance is stable and that the devices are not destroyed. Resistors62-66 scales the input voltage to be less than 1 Volt peak to peak toprocessor 14. It is noted that resistors 62-66 can be in a range fromabout 100 ohms to about 1 k ohms in order to assure this maximum peak topeak voltage and still maintain maximum signal.

On grounded, three wire delta systems, those components of theelectronics assembly operating on logic voltage levels (including thebattery connector) can be at an elevated voltage. In such situations,the two, 1 Meg resistor combinations (50/52, 54/56, 58/60) providecurrent limiting to the logic level electronics. The worse case currentoccurs during testing of a 480 V, 3 wire delta meter with single phaseexcitation.

It will be appreciated that energy units are calculated primarily frommultiplication of voltage and current. The specific formulae utilized inthe preferred embodiment, are listed in Table 1. It should be noted thatthe present embodiment provides a wide range of voltage operation asdescribed in copending application Ser. No. 839,967. This especiallypreferred embodiment allows four wire delta applications to be meteredusing a four wire wye meter executing the four wire wye equations inTable 1. However, for purposes of FIG. 2, such formulae are performed inprocessor 14. Processor 14 includes an analog converter 70 and aprogrammable DSP 72. Converter 70 includes, three three-channel,over-sampled, 2nd order, sigma-delta A/D converters, depicted as a 9channel ΣΔ analog-to-digital converter 74. The 6.2208 MHz clock signalis divided by 3 such that each A/D samples its input at 2.0736 MHz. EachA/D performs a 96:1 reduction or averaging for each input that resultsin an effective sample rate of 2.4 kHz on each of the three inputs perA/D. The resolution of these samples is equivalent to 21 bits, plussign. It is noted that such a ΣΔ analog-to-digital conversion schemeresults in a correct convergence by each A/D for each sample converted.It is recognized that the bandwidth for such a conversion scheme isrelatively small, however, the frequency of the voltage and currentbeing converted is also relatively small.

In the preferred embodiment, the three voltage inputs, Va, Vb and Vc aresampled by one of the A/D's and the three current inputs Ia, Ib and Icare sampled by a second A/D. The third A/D is used to sample either thevoltage or current input of the B phase. Such sampling of the voltage orcurrent input of the B phase is done because so-called 21/2 elementmeters require the combination of the B phase current with one or bothof the other phase currents. In addition, so-called two element metersrequire the B phase voltage to be combined with the other phase voltagesto produce the line to line voltage. Having a third A/D enables theseterms to be sampled simultaneously, thereby improving the measurementaccuracy. This also improves the signal to noise ratio within processor14.

DSP 72 is a reduced instruction set processor (RISC) which computes thedesired energy quantities from the converted voltage and currentsamples. DSP 72 is shown to include a random access memory (RAM) memory76 having a capacity of 256 bytes of data. Memory 76 is used to storecomputations and the subroutine stack. A read only memory (ROM) 78 isalso shown and has a capacity of 640 bytes of data. Memory 78 is used tostore those metering subroutines common to all energy calculation.Another RAM memory 80 is depicted and has a capacity of 256 bytes ofdata. Memory 80 is used to store the main line program and specializedsubroutines of DSP 72.

DSP 72 is also shown to include multiplier 82 and an accumulator 84 forprocessing the voltage and current digital signals thereby generatingelectrical energy information. There is also included arithmeticsubtraction unit 86 interposed between multiplier 82 and accumulator 84.

From the foregoing, it should be appreciated that program ROM, i.e.memory 76 is defined at the oxide via level. As this defining stepoccurs relatively late in the manufacturing process for processor 14,changes can be made to such programming with minimal effort.

Calibration constants for each phase and certain potential linearizationconstants are stored in memory 80. Memories 76 and 80 are seriallydown-loaded from EEPROM 35 by microcontroller 16 on power-up of meter10. Such an embodiment allows the benefit of being able to providevarious meter forms economically, to calibrate without hardwaremodification, and permits the future addition of metering VAR or VAbased on the per phase Vrms and Irms. The formulae for such operationsare included in Table 1. Furthermore, the calculation of future, yetundefined, complex metering quantities could be obtained by merelyreprogramming processor 14.

Processor 14 also contains a crystal oscillator (not shown), serialinterface 88, power fail detect circuitry 90, and potential presentoutputs B and C. The crystal oscillator requires an external 6.2208 MHzcrystal oscillator 34. Processor 14 uses this frequency directly fordriving the DSP and indirectly for the A/D sampling. This frequency isalso operated upon by clock generator 92 which serves to divide theoutput of oscillator 34 (input to processor 14 at XIN and XOUT) by 1.5,to buffer the divided clock signal and to output the divided clocksignal at CK to processor 16 as its clock. This clock output isspecified to work down to a supply voltage of 2.0 VDC.

Serial interface 88 is a derivation of the Signetics IIC bus. One serialaddress is assigned to processor 14. This address accesses one of thefour DSP control registers. All information must pass through DSP dataregister 94 after writing the DSP address register. All memory,registers, and outputs of processor 14 can be read serially. A chipselect line CS has been added to disable the communications buffer. Theinput CS is connected to and controlled by processor 16.

Power fail detection circuit 90 is a comparator which compares a dividedrepresentation of the supply voltage to a precision reference. Thecomparator's output at A concurrently provides a power fail signal andan indication of the presence of A phase voltage. Upon power fail, it ispreferable to reset processor 14. In such a situation, the output pinsWhr, Whd, etc. are forced to logic low voltage levels. Additionally,processor 14 goes into a lower power mode to reduce the current draw onpower supply 20. In this lower power mode the comparator and oscillatoroperation are not affected, but DSP 72 ceases to operate.

The power failure voltage PF is generated by dividing the output ofsupply 22 to generate a voltage which is slightly greater than 2.5 V. Inthe preferred embodiment, a resistor voltage divider provides PF. SincePF is generated in relation to the Phase A voltage (FIG. 1), itspresence is an indication that the Phase A voltage is also present.

In order to appreciate how the reference voltage is generated considerFIG. 7. There is shown in greater detail the components included inlinear power supply 22. The 5 V output of supply 22 is provided at 96 inFIG. 6. Resistor 98 and diode 100 combine to generate a precision 2.5 Vreference voltage. It is noted at this point that Va, Vb, Vc, Ia, Ib andIc are each provided to processor 14 in reference to VREF.

Consider again processor 14 as shown in FIG. 2. The phase B and Cpotential indicators outputs are under control of DSP 72. The B outputis normally a logic level output. The C output also provides the powerline time base function (note that phase C is present in allapplications). To minimize noise at the power line fundamental, thistime base is at two times the power line fundamental.

The M37428 microcontroller 16 is a 6502 (a traditional 8 bitmicroprocessor) derivative with an expanded instruction set for bit testand manipulation. This microcontroller includes substantialfunctionality including internal LCD drivers (128 quadraplexedsegments), 8 kbytes of ROM, 384 bytes of RAM, a full duplex hardwareUART, 5 timers, dual clock inputs (32.768 kHz and up to 8 MHz), and alow power operating mode.

During normal operation, processor 16 receives the 4.1472 MHz clock fromprocessor 14 as described above. Such a clock signal translates to a1.0368 MHz cycle time. Upon power fail, processor 16 shifts to the32.768 kHz crystal oscillator 32. This allows low power operation with acycle time of 16.384 kHz. During a power failure, processor 16 keepstrack of time by counting seconds and rippling the time forward. Onceprocessor 16 has rippled the time forward, a WIT instruction is executedwhich places the unit in a mode where only the 32.768 kHz oscillator andthe timers are operational. While in this mode a timer is setup to "wakeup" processor 16 every 32,768 cycles to count a second.

Consider now the main operation of processor 16 in relation to FIGS.3A-3E and FIG. 4. At step 1000 a reset signal is provided tomicrocontroller 16. As will be appreciated in relation to the discussionof FIG. 5, a reset cycle occurs whenever the voltage level V_(dd) risesthrough approximately 2.8 volts. Such a condition occurs when the meteris first powered up.

At step 1002, microcontroller 16 performs an initialize operation,wherein the stack pointer is initialized, the internal ram isinitialized, the type of liquid crystal display is entered into thedisplay driver portion of microcontroller 16 and timers which requireinitialization at power up are initialized. It will be noted that theoperation of step 1002 does not need to be performed for each powerfailure occurrence. Following a power failure, microcontroller 16 atstep 1004 returns to the main program at the point indicated when thepower returns.

Upon initial power up or the return of power after a power failure,microcontroller 16 performs a restore function. At step 1006,microcontroller 16 disables pulses transmitted by processor 14. Thesepulses are disabled by providing the appropriate signal restore bit. Thepresence of this bit indicates that a restore operation is occurring andthat pulses generated during that time should be ignored. Having set thesignal restore bit, microcontroller 16 determines at step 1008 whetherthe power fail signal is present. If the power fail signal is present,microcontroller 16 jumps to the power fail routine at 1010. In the powerfail routine, the output ports of microcontroller 16 are written lowunless the restore bit has not been set. If the restore bit has not beenset, data in the microcontroller 16 is written to memory.

If the power fail signal is not present, microcontroller 16 displayssegments at step 1012. At this time, the segments of the display areilluminated using the phase A potential. It will be recalled that phaseA potential is provided to microcontroller 16 from processor 14. At1014, the UART port and other ports are initialized at 1016, the powerfail interrupts are enabled such that if a falling edge is sensed fromoutput A of processor 14, an interrupt will occur indicating powerfailure. It will be recalled that processor 14 compares the referencevoltage VREF to a divided voltage generated by the power supply 20.Whenever the power supply voltage falls below the reference voltage apower fail condition is occurring.

At step 1018, the downloading of the metering integrated circuit isperformed. Such downloading operation is described in greater detail inrelation to FIG. 4. At step 1020, the timer interrupts are enabled. Itwill be appreciated that certain tasks performed by microcontroller 16are time dependent. Such tasks will require a timer interrupt when thetime for performing such tasks has arrived.

At 1022, the self-test subroutines are performed. Although no particularself-tests subroutine is necessary in order to practice the presentinvention, such subroutines can include a check to determine if properdisplay data is present. It is noted that data is stored in relation toclass designation and that a value is assigned to each class such thatthe sum of the class values equals a specified number. If any displaydata is missing, the condition of the class values for data which ispresent will not equal the specified sum and an error message will bedisplayed. Similarly, microcontroller 16 compares the clock signalgenerated by processor 14 with the clock signal generated by watchcrystal 32 in order to determine whether the appropriate relationshipexists.

Having completed the self-test subroutines, the ram is re-initialized at1024. In this re-initialization, certain load constants are cleared frommemory. At 1026, various items are scheduled. For example, the displayupdate is scheduled so that as soon as the restore routine is completed,data is retrieved and the display is updated. Similarly, opticalcommunications are scheduled wherein microcontroller 16 determineswhether any device is present at optical port 40, which device desiresto communicate. Finally, at 1028 a signal is given indicating that therestore routine has been completed. Such a signal can include disablingthe signal restore bit. Upon such an occurrence, pulses previouslydisabled will now be considered valid. Microcontroller 16 now moves intothe main routine.

At 1030, microcontroller 16 calls the time of day processing routine. Inthis routine, microcontroller 16 looks at the one second bit of itsinternal clock and determines whether the clock needs to be changed. Forexample, at the beginning and end of Daylight Savings Time, the clock ismoved forward and back one hour, respectively. In addition, the time ofday processing routine sets the minute change flags and date changeflags. As will be appreciated hereinafter, such flags are periodicallychecked and processes occur if such flags are present.

It will be noted that there are two real time interrupts scheduled inmicrocontroller 16 which are not shown in FIG. 3, namely the roll minuteinterrupt and the day interrupt. At the beginning of every minute,certain minute tasks occur. Similarly, at the beginning of every day,certain day tasks occur. Since such tasks are not necessary to thepractice of the presently claimed invention, no further details need beprovided.

At 1032, microcontroller 16 determines whether a self-reprogram routineis scheduled. If the self-reprogram routine is scheduled, such routineis called at 1034. The self-reprogram typically programs in new utilityrates which are stored in advance. Since new rates have beenincorporated, it will be necessary to also restart the display. Afteroperation of the self-reprogram routine, microcontroller 16 returns tothe main program. If it is determined at 1032 that the self-reprogramroutine is not scheduled, microcontroller 16 determines at 1036 whetherany day boundary tasks are scheduled. Such a determination is made bydetermining the time and day and searching to see whether any day tasksare scheduled for that day. If day tasks are scheduled, such tasks arecalled at 1038. If no day tasks are scheduled, microcontroller 16 nextdetermines at 1040 whether any minute boundary tasks have beenscheduled. It will be understood that since time of use switch pointsoccur at minute boundaries, for example, switching from one use periodto another, it will be necessary to change the data storage locations atsuch a point. If minute tasks are scheduled, such tasks are called at1042. If minute boundary tasks have not been scheduled, microcontroller16 determines at 1044 whether any self-test have been scheduled. Theself-tests are typically scheduled to occur on the day boundary. Asindicated previously, such self-tests can include checking theaccumulative display data class value to determine whether the sum isequal to a prescribed value. If self-tests are scheduled, such tests arecalled at 1046. If no self-tests are scheduled, microcontroller 16determines at 1048 whether any season change billing data copy isscheduled. It will be appreciated that as seasons change billing datachanges. Consequently, it will be necessary for microcontroller 16 tostore energy metered for one season and begin accumulating energymetered for the following season. If season change billing data copy isscheduled, such routine is called at 1050. If no season change routineis scheduled, microcontroller 16 determines at 1052 whether theself-redemand reset has been scheduled. If the self-redemand reset isscheduled, such routine is called at 1054. This routine requiresmicrocontroller 16 to in effect read itself and store the read value inmemory. The demand reset is then reset. If the self-demand reset has notbeen scheduled, microcontroller 16 determines at 1056 whether a seasonchange demand reset has been scheduled. If a season change demand resetis scheduled, such a routine is called at 1058. In such a routine,microcontroller 16 reads itself and resets the demand.

At 1060, microcontroller 16 determines whether button sampling has beenscheduled. Reference is made to FIG. 8 for a more detailed descriptionof an arrangement of buttons to be positioned on the face of meter 10.Button sampling will occur every eight milliseconds. Consequently, if aneight millisecond period has passed, microcontroller 16 will determinethat button sampling is scheduled and the button sampling routine willbe called at 1062.

If button sampling is not scheduled, microcontroller 16 determines at1064 whether a display update has been scheduled. This routine causes anew quantity to be displayed on LCD 30. As determined by the soft switchsettings mentioned above, display updates are scheduled generally forevery three-six seconds. If the display is updated more frequently, itmay not be possible to read the display accurately. If the displayupdate has been scheduled, the display update routine is called at 1066.

If a display update has not been scheduled, microcontroller 16determines at 1068 whether an annunciator flash is scheduled. It will berecalled that certain annunciators on the display are made to flash.Such flashing typically occurs every half second. If an annunciatorflash is scheduled, such a routine is called at 1070. If no annunciatorflash is scheduled, microcontroller 16 determines at 1072 whetheroptical communication has been scheduled. It will be recalled that everyhalf second microcontroller 16 determines whether any signal has beengenerated at optical port. If a signal has been generated indicatingthat optical communications is desired, the optical communicationroutine will be scheduled. If the optical communication routine isscheduled, such routine is called at 1074. This routine causesmicrocontroller 16 to sample optical port 40 for communication activity.

If no optical routine is scheduled, microcontroller 16 determines at1076 whether processor 14 is signaling an error. If processor 14 issignaling an error, microcontroller 16 at 1078 disables the pulsedetection, calls the download routine and after performance of thatroutine, re-enables the pulse detection. If processor 14 is notsignaling any error, microcontroller 16 determines at 1080 whether thedownload program is scheduled. If the download program is scheduled, themain routine returns to 1078 and thereafter back to the main program.

If the download program has not been scheduled or after the pulse detecthas been re-enabled, microcontroller 16 determines at 1082 whether awarmstart is in progress. If a warmstart is in progress, the power failinterrupts are disabled at 1084. The pulse computation routine is calledafter which the power fail interrupts are re-enabled. It will be notedthat in the warmstart data is zeroed out in order to provide a freshstart for the meter. Consequently, the pulse computation routineperforms the necessary calculations for energy previously metered andplaces that computation in the appropriate point in memory. If awarmstart is not in progress, microcontroller 16 at 1084 updates theremote relays. Typically, the remote relays are contained on a boardother than the electronics assembly board.

Referring now to FIG. 4, the program for downloading processor 14 willbe described. At 1100, microcontroller 16 enters the program. At 1102,the schedule indicating that a metering download should take place iscleared. At 1104, Microcontroller 16 initializes the communication bus,which in the preferred embodiment is INTB. At 1106, microcontroller 16resets and stops processor by way of an interrupt on processor 14.However, if there is a communications error between microcontroller 16and processor 14, microcontroller 16 at 1108 sets a warning andschedules a download of processor 14. After 1108 the downloading programis terminated, microcontroller 16 returns to the main routine.

At 1110, microcontroller reads and saves the pulse line states. It willbe recalled that as processor 14 makes energy determinations, each unitof energy is represented by a logic transition on outputs 42-48 (FIG.1). At 1110 the state of each output 42-48 is saved. At 1112,microcontroller initializes A/D converters 74, if a communication erroroccurs, microcontroller proceeds to 1108. At 1114 the digital signalprocessing registers 94 are initialized. At 1116 program memory 78 isdownloaded to memory. At 1118, the data memory 80 is downloaded tomemory. At 1120, processor 14 is started. If a communication erroroccurs at any of steps 1114-1120, microcontroller 16 again returns to1108. At 1122, any warning messages previously set at 1108 are cleared.At 1124, microcontroller 16 returns to its main program.

All data that is considered non-volatile for meter 10, is stored in a 2kbyte EEPROM 35. This includes configuration data (including the datafor memory 76 and memory 80), total kWh, maximum and cumulative demands(Rate A demands in TOU), historic TOU data, cumulative number of demandresets, cumulative number of power outages and the cumulative number ofdata altering communications. The present billing period TOU data isstored in the RAM contained within processor 16. As long as themicrocontroller 16 has adequate power, the RAM contents and real timeare maintained and the microcontroller 16 will not be reset (even in ademand register).

As indicated previously, operational constants are stored in EEPROMdata. Microcontroller 16 performs checks of these memory areas by addingthe class designations for various data and comparing the sum to areference number. For example, the data class is used to define the 256byte block of program memory. Appended to the 256 bytes of program inthis data class is the DSP code identification, revision number, and thechecksum assigned to this data class. The operational constants consistof the calibration constants and data RAM initial values, the meter'ssecondary Ke and Kh, and information that the microcontroller must useto process the meter's data.

LCD 30 allows viewing of the billing and other metering data andstatuses. Temperature compensation for LCD 30 is provided in theelectronics. Even with this compensation, the meter's operatingtemperature range and the LCD's 5 volt fluid limits LCD 30 to beingtriplexed. Hence, the maximum number of segments supported in thisdesign is 96. The display response time will also be noticeably slow attemperatures below -30 degrees Celsius. For a more complete descriptionof display 30, reference is made to copending application Ser. No.839,634 incorporated herein by reference.

Referring now to FIG. 5, optical port 40 and reset circuitry 108 areshown in greater detail. On power up, reset 108 provides an automaticreset pulse to processor 16. In operation, circuit 108 acts as acomparator, comparing a portion of the voltage generated by power supply22 to the voltage provided by non-volatile supply 24. Whenever thevoltage generated by power supply 22 either falls below or rises abovethat of the non-volatile supply, such a condition is an indication thatthe meter has either lost power or power has been restored and a resetsignal is provided to processor 16.

Optical port 40 provides electronic access to metering information. Thetransmitter and receiver (transistors 110 and 112) are 850 nanometerinfrared components and are contained in the electronics assembly (asopposed to being mounted in the cover). Transistor 110 and LED 112 aretied to microcontroller 16's UART and the communications rate (9600baud) is limited by the response time of the optical components. Theoptical port can also be disabled from the UART (as described below),allowing the UART to be used for other future communications withoutconcern about ambient light. During test mode, the optical port willecho the watthour pulses received by the microcontroller over thetransmitting LED 112. While in test mode microcontroller 16 will monitorthe receive line 114 for communications commands.

One feature which results from the distributed processing schemedescribed above is the adaptability or expandability of the invention infuture applications. To this end, option connector 38 will play a keyrole. As shown in FIG. 1, option connector provides a connection fromprocessor 16 to the outside world. Through connector 38 data output fromprocessor 14 to EEPROM 35 or data output to processor 16 can bemonitored. As will be described below, communication with processor 16can occur since connector 38 is directly connected to several ports onprocessor 16. Thus through option connector 38, communication withprocessor 16 is possible and the operation of processor 16 may bemodified. For example, connector 38 may be used in order to convertmeter 10 effectively into a peripheral device for anothermicrocontroller (not shown). Option connector 38 might be used inrelation to a modem in order to access pieces of data or to operateoptical port 40 in some desired fashion. Connector 38 may also be usedin relation to so called 3rd party services. In such situations, thirdparties may be contracted to service the meter using their ownequipment. Through connector 38 it may be possible to more readily adaptsuch equipment to be capable of servicing meter 10. Connector 38 mayalso be utilized for the connection of a device for the storage of anenergy use profile. Such devices require nonvolatile supply voltages.The features made available on connector 38 makes it possible to"piggy-back" such a device on meter 10.

As indicated above, it is desirable for meter 10 to economically performexisting polyphase demand and time-of-use (TOU) metering as well as bethe platform for future metering products. Unfortunately, little isknown about the future. The problem therefore is how one allows for thechanges the future might bring. The approach taken by the invention,allows the electronics in meter 10 to act as a peripheral device to anoption board (not shown) connected to option connector 38, whilesupplying nominal power requirements for the option board. All power,signals, and communications to the option board are provided over a 20pin connection.

Meter 10 provides the following power signals:

V+ A semi-regulated 12 VDC to 15 VDc supply (the output of supply 20);

5 V A regulated 5 V volatile supply (the output of supply 22);

VDD A regulated 5 V non-volatile supply (the output of supply 24); and

Gnd The negative reference.

In the preferred embodiment, the option board is allowed a combinedcurrent draw of 50 mA on these three supply signals. The option boardcan be allowed to draw up to 100 μA from a supercapacitor contained inthe output portion of supply 20 and battery 26 via supply 24 during apower outage, however, such an arrangement will reduce battery life.

Referring to FIG. 1, meter 10 also provides the following operationalsignals to option connector 38:

PFail Preferably logic level low (0) indicates the absence of AC power;

MR Master Reset--A logic level low (0) generated by circuit 108 (FIG.5), used to reset the microcontroller upon loss of VDD (preferablydefined as VDD falling below 2.8 to 2.2 volts);

Alt An echo or duplication of the alternate display button position(determined by processor 16 at 1060);

Reset An echo or duplication of the demand reset button position(determined by processor 16 at 1060);

EOI End of demand interval indication, generated by processor 16 inrelation to the main program at 1052, preferably high for one second atthe end of the demand interval;

KYZ1 A KYZ output signal of watthour pulses subject to a pulse frequencydivider and a watthour accumulation definition, wherein the accumulationdefinition allows the KYZ signal to repeat the watthours deliveredpulses or a combination of watthours delivered and watthours receivedpulses;

KYZ2 A KYZ output signal of the VARhour or VAhour pulses also subject tothe KYZ divider and accumulation definition;

WHR The watthour received pulse train from processor 14; and

VARHR The VARhours received pulse train from processor 14.

By providing the PFail signal to option connector 38, determinations canbe made of when AC power is no longer present. In the preferredembodiment, meter 10 guarantees that 100 ms of power supply remains whenthe PFail signal is generated. The Master Reset signal can be used toreset any microprocessor that may be connected to option connector 38,if it is powered from the V_(dd) supply. Otherwise, an option boardmicrocomputer can be reset from a time delay on the PFail line. TheKYZ1, KYZ2, WHR, and VARHR signals can be used to monitor the variouspower flow measurements. The EOI signal can be used to synchronizedemand intervals between processor 16 and a microcomputer connected tooption connector 38.

Meter 10 further provides the following communications connections:

SC1 Serial Clock--connection to serial communications line 36,particularly the serial clock connection with serial interface 88 (FIG.2), wherein a serial clock is transmitted conforming to the I² C serialprotocol;

SDA Serial Data--connection to serial communications line 36,particularly the serial data connection with serial interface 88 (FIG.2), wherein serial bi-directional serial data is transmitted conformingto the I² C serial protocol;

RX A connection to the serial receive communications line connectingprocessor 16 and optical port 40;

TX A connection to the serial transmit communications line connectingprocessor 16 and optical port 40;

OPE Optical Port Enable--a connection to processor 16 and optical port40 wherein a logic level high (1) allows access to optical port 40 bythe RX and TX signals provided to option connector 38 by an optionboard;

OPS Optical Port Select--a connection to processor 16, wherein a logiclevel high (1) results in processor 16 controlling the drive to opticalport 40 and logic level low (0) allows a microprocessor connected tooption connector 38 to drive optical port 40; and

DS Display Select--a connection to processor 16 wherein a logic levelhigh (1) results in processor 16 controlling the drive to liquid crystaldisplay 30 and logic level low (0) allows a microprocessor connected tooption connector 38 to drive display 30.

The SC1 and SDA connections could be used to drive an I² C I/O expanderwhich in turn would provide signals from meter 10 to multiple outputrelays. The RX, TX, and OPE connections would normally be used to driveoptical port 40. If the OPS line is pulled low, processor 16 would nolonger attempt to drive optical port 40, but instead would listen at9600 baud for an option board microcomputer to "talk" to processor 16.When the OPE line is high, processor 16 is commanded to assume that theoption board is communicating out optical port 40 and thus to ignore thecommunication. This allows meter 10 through processor 16 to become acommunications and data processing peripheral to option connector 38.EEPROM 35, in the preferred embodiment has 256 bytes of extra memoryspace that can be accessed through option connector 38 via the normalcommunications protocol. In such a situation, meter 10 can be either adata storage or configuration storage peripheral.

When the signal on the DS connection is high, processor 16 controlsdisplay 30 per information processor 16 stores in EEPROM 35. It will benoted that, in the preferred embodiment, the liquid crystal display iscontrolled in relation to information contained in a display table (notshown) which table contains identifier and data fields (numeric fieldsand identification annunciators) and which table is stored in memory 35.In the preferred embodiment, the display table is a display segmentmemory map stored in memory 35 to produce the desired display image ondisplay 30. When processor 16 controls display 30, the display table isperiodically updated with information generated by processor 16. If theDS line is pulled low through option connector 38, processor 16 nolonger updates the display table. In such a situation, a specialcommunications command is provided in processor 16 to allow the displayidentifiers and data to be written through option connector 38,preferably by a microcomputer connected to connector 38. Thus meter 10has the flexibility to become a display peripheral to an option board.

In an especially preferred embodiment, pulse indicators, potentialindicators, the "EOI" indicator, and the "Test" indicator located indisplay 30 are controlled by fields in the display table, which fieldscan only be modified by information generated by processor 16. In suchan embodiment, even if DS is low, processor 16 will still generate thiscertain field information. Information provided meter 10 through optionconnector 38 will be exclusive ORed with information generated byprocessor 16 to update the display table.

It will be appreciated from the above that an option board can be easilyadded to meter 10. As discussed above, the option board can then takecontrol of most functions of meter 10, including modifying the basicmetering function and reading processor 14 directly via processor 16.This aspect to the design allows a great deal of flexibility for future,yet undefined, functions.

In addition to the option board connector, space is preferably providedin chassis (not shown) of meter 10 for additional large components, suchas carrier coupling components or a larger power supply transformer. Thevoltage connections in the meter base provide additional tabs forpicking off the line voltage for parts of this nature.

Meter 10 also provides the ability to be placed in the test mode andexit from the test mode via a new optical port function. When in anoptically initiated test mode, the meter will echo metering pulses asdefined by the command on the optical port transmitter. The meter willlisten for further communications commands. Additional commands canchange the rate or measured quantity of the test output over the opticalport. The meter will "ACK" any command sent while it is in the test modeand it will "ACK" the exit test mode command. While in an opticallyinitiated test mode, commands other than those mentioned above areprocessed normally. Because there is the possibility of an echoed pulseconfusing the programmer/readers receiver, a command to stop the pulseecho may be desired so communications can proceed uninterrupted. If leftin test mode, the usual test mode time out of three demand intervalsapplies. For a more complete description of the test mode, reference ismade to copending application Ser. No. 839,634.

                                      TABLE 1                                     __________________________________________________________________________    Meter Formulae                                                                __________________________________________________________________________    Watt formulae                                                                 -3:Watts = K.sub.G (K.sub.A V.sub.A.sbsb.0 I.sub.A.sbsb.0  + K.sub.B          V.sub.B.sbsb.1 I.sub.B.sbsb.1  + K.sub.C V.sub.C.sbsb.2 I.sub.C.sbsb.2)       -2:Watts = K.sub.G ((K.sub.A V.sub.A.sbsb.0  - K.sub.B V.sub.B.sbsb.0)I.su    b.A.sbsb.0  + (K.sub.C V.sub.C.sbsb.2  - K.sub.D V.sub.B.sbsb.2)I.sub.C.sb    sb.2)                                                                         -8:Watts = K.sub.G (K.sub.A V.sub.A.sbsb.0 I.sub.A.sbsb.0  - (K.sub.B         V.sub.A.sbsb.0 I.sub.B.sbsb.0  + K.sub.D V.sub.C.sbsb.2 I.sub.B.sbsb.2) +     K.sub.C V.sub.C.sbsb.2 I.sub.C.sbsb.2)                                        -7:Watts = K.sub.G (K.sub.A V.sub.A.sbsb.0 I.sub.A.sbsb.0  - K.sub.B          V.sub.A.sbsb.0 I.sub.B.sbsb.0  + K.sub.C V.sub.C.sbsb.2 I.sub.C.sbsb.2)        NOTE: Subscripts refer to the phase of the inputs. Subsubscripts refer to     the A/D cycle in which  the sample is taken. Va for  -7 applications is       actually line to neutral.                                                

    VA Formulae                                                                   -3:VA = K.sub.G (K.sub.A V.sub.A.sbsb.0.sub.rms I.sub.A.sbsb.0.sub.rms  +     K.sub.B V.sub.B.sbsb.1.sub.rms I.sub.B.sbsb.1.sub.rms  + K.sub.C V.sub.C.s    bsb.2.sub.rms I.sub.C.sbsb.2.sub.rms)                                         -2:VA = K.sub.G ((K.sub.A V.sub.A.sbsb.0  - K.sub.B V.sub.B.sbsb.0).sub.rm    s I.sub.A.sbsb.0.sub.rms  + (K.sub.C V.sub.C.sbsb.2  - K.sub.D V.sub.B.sbs    b.2).sub.rms I.sub.C.sbsb.2.sub.rms)                                           ##STR1##                                                                     -7:VA = K.sub.G (K.sub.A V.sub.A.sbsb.0.sub.rms I.sub.A.sbsb.0.sub. rms       + K.sub.B V.sub.A.sbsb.0.sub.rms I.sub.B.sbsb.0.sub.rms  + K.sub.C            V.sub.C.sbsb.2.sub.rms I.sub.C.sbsb.2.sub.rms)                                RMS measurements are made over one line cycle and preferably begin at the     zero crossing of each voltage.                                                VAR Formula                                                                    ##STR2##                                                                     where the subscripts are associated with the I terms of Watts and VAs and     the calculation is                                                            performed every cycle as shown below:                                          ##STR3##                                                                      ##STR4##                                                                      ##STR5##                                                                      ##STR6##                                                                      ##STR7##                                                                      ##STR8##                                                                      ##STR9##                                                                      ##STR10##                                                                     ##STR11##                                                                    __________________________________________________________________________

For purposes of the above formulae, the following definitions apply:

-2 means a 2 element in 3 wire delta application;

-3 means a 3 element in 4 wire wye application and in 4 wire deltaapplication;

-8 means a 21/2 element in 4 wire wye application;

-5 means a 2 element in 3 wire delta application;

-7 is a 21/2 element in 4 wire delta application.

While the invention has been described and illustrated with reference tospecific embodiments, those skilled in the art will recognize thatmodification and variations may be made without departing from theprinciples of the invention as described herein above and set forth inthe following claims.

What is claimed is:
 1. A method of metering electrical energy comprisingthe steps of:sensing each phase of a circuit to generate analog voltagesignals and analog current signals associated with each phase;converting said analog voltage signals and said analog current signalsinto digital voltage signals and digital current signals, respectively,using time division multiplexing to provide three digital outputs, eachdigital output comprising at least one digital voltage signal and atleast one digital current signal associated with the same phase; andprocessing said digital outputs to generate signals representative ofreal power, the magnitude of reactive power, and apparent power, whereinsaid signals representative of the magnitude of reactive power aregenerated from said signals representative of real power and saidsignals representative of apparent power.
 2. The method of claim 1,wherein said processing step comprises the step of:processing saiddigital voltage signals and said digital current signals to generate anRMS voltage and an RMS current, respectively.
 3. The method of claim 2,wherein the meter is configured for a 2-element, 3-wire deltaapplication such that said digital outputs are processed in accordancewith the following formula: ##EQU1## where all V values representvoltages, all I values represent currents, and all K values representcalibration constants, wherein subscripts A, B, and C represent phasesof the circuit, and sub-subscripts 0, 1, and 2 represent each of saidthree digital outputs, and wherein all RMS subscripts of V and I valuesindicate the value is the RMS voltage and RMS current, respectively. 4.The method of claim 2, wherein the meter is configured for a 3-element,4-wire wye application such that said digital outputs are processed inaccordance with the following formula: ##EQU2## where all V valuesrepresent voltages, all I values represent currents, and all K valuesrepresent calibration constants, wherein subscripts A, B, and Crepresent phases of the circuit, and sub-subscripts 0, 1, and 2represent each of said three digital outputs, and wherein all RMSsubscripts of V and I values indicate the value is the RMS voltage andthe RMS current, respectively.
 5. The method of claim 2, wherein themeter is configured for a 3-element, 4-wire delta application such thatsaid digital outputs are processed in accordance with the followingformula: ##EQU3## where all V values represent voltages, all I valuesrepresent currents, and all K values represent calibration constants,wherein subscripts A, B, and C represent phases of the circuit, andsub-subscripts 0, 1, and 2 represent each of said three digital outputs,and wherein all RMS subscripts of V and I values indicate the value isthe RMS voltage and the RMS current, respectively.
 6. The method ofclaim 2, wherein the meter is configured for a 21/2-element, 4-wiredelta application such that said digital outputs are processed inaccordance with the following formula: ##EQU4## where all V valuesrepresent voltages, all I values represent currents, and all K valuesrepresent calibration constants, wherein subscripts A, B, and Crepresent phases of the circuit, and sub-subscripts 0, 1, and 2represent each of said three digital outputs, and wherein all RMSsubscripts of V and I values indicate the value is the RMS voltage andthe RMS current, respectively.